import http from '@/utils/http'

export function userApi(data, params) {
  return http.request({
    url: '/api/user/getAll',
    method: 'POST',
    data,
    params
  })
}

export function userDeleteApi(_id) {
  return http.request({
    url: `/api/user/${_id}`,
    method: 'DELETE',
  })
}

export function userDetailApi(_id) {
  return http.request({
    url: `/api/user/${_id}`,
    method: 'GET',
  })
}

export function userAddApi(data) {
  return http.request({
    url: `/api/user`,
    method: 'POST',
    data,
  })
}

export function userUpsertApi(data) {
  return http.request({
    url: `/api/user/${data?.id}`,
    method: 'PUT',
    data,
  })
}